package com.mlm.mlmapp;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.OnActivityResult;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.sharedpreferences.Pref;
import org.json.JSONException;
import org.json.JSONObject;

import android.content.Intent;
import android.widget.TextView;

import com.flyco.animation.BaseAnimatorSet;
import com.mlm.mlmapp.activity.BaseActivity;
import com.mlm.mlmapp.activity.BookActivity_;
import com.mlm.mlmapp.activity.ComboListActivity_;
import com.mlm.mlmapp.activity.CommentSubmitActivity_;
import com.mlm.mlmapp.activity.CouponGetListActivity_;
import com.mlm.mlmapp.activity.CouponListActivity_;
import com.mlm.mlmapp.activity.CouponMineActivity_;
import com.mlm.mlmapp.activity.DresserCommentsListActivity_;
import com.mlm.mlmapp.activity.HairDresserDetailActivity_;
import com.mlm.mlmapp.activity.HairDresserListActivity_;
import com.mlm.mlmapp.activity.HairStyleDetailActivity_;
import com.mlm.mlmapp.activity.HairStyleListActivity_;
import com.mlm.mlmapp.activity.LoginActivity_;
import com.mlm.mlmapp.activity.MLMSplashActivity_;
import com.mlm.mlmapp.activity.ModifyMobileActivity_;
import com.mlm.mlmapp.activity.ModifyNickNameActivity_;
import com.mlm.mlmapp.activity.ModifyPWDActivity_;
import com.mlm.mlmapp.activity.MyCommentsListActivity_;
import com.mlm.mlmapp.activity.OrdersActivity_;
import com.mlm.mlmapp.activity.PaymentActivity_;
import com.mlm.mlmapp.activity.StudioListActivity_;
import com.mlm.mlmapp.activity.UserInfoActivity_;
import com.mlm.mlmapp.activity.UserSettingActivity_;
import com.mlm.mlmapp.adapter.view.OrderDialog;
import com.mlm.mlmapp.interfaces.Prefs_;

@EActivity(R.layout.activity_test_enterence)
public class TestEnterenceActivity extends BaseActivity {
	@Pref
	Prefs_ pref;
	OrderDialog confirm;
	@ViewById
	TextView tv_title;

	@AfterViews
	void init() {
		String title=getTitle().toString();
		if(!"".equals(title)){
			((TextView) this.findViewById(R.id.tv_title)).setText(title);
		}
		
		setTranStatusBar();
		pref.edit().loginID().put("18145681611").apply();

	}

	@Click
	void button1() {
		MLMSplashActivity_.intent(this).start();
//		MainActivity_.intent(this).start();
	}

	@Click
	void button2() {
		LoginActivity_.intent(this).start();
	}

	@Click
	void button3() {
		HairStyleListActivity_.intent(this).start();
	}

	@Click
	void button4() {

		HairStyleDetailActivity_.intent(this).extra("id", "1").start();
	}

	@Click
	void button5() {
		HairDresserListActivity_.intent(this).start();
	}

	@Click
	void button6() {
		HairDresserDetailActivity_.intent(this).extra("id", "1").start();
	}

	@Click
	void button7() {

		UserInfoActivity_.intent(this).start();

	}

	@Click
	void button8() {

		pref.clear();

	}

	@Click
	void button9() {
		MyCommentsListActivity_.intent(this).start();

	}

	@Click
	void button10() {
		DresserCommentsListActivity_.intent(this).extra("dresserid", "1")
				.start();

	}

	BaseAnimatorSet bas_in = new com.flyco.animation.SlideEnter.SlideBottomEnter();
	BaseAnimatorSet bas_out = new com.flyco.animation.SlideExit.SlideBottomExit();

	@Click
	void button11() {

		ModifyMobileActivity_.intent(this).startForResult(REQUEST_CODE);
	}

	@Click
	void button111() {
		pref.edit().loginID().put("13866666666").apply();
		ModifyNickNameActivity_.intent(this).extra("oldname", "oldname")
				.startForResult(REQUEST_CODE);
	}

	@OnActivityResult(REQUEST_CODE)
	void onResult(Intent data) {
		if (data != null) {
		}
	}

	@Click
	void button12() {
		UserSettingActivity_.intent(this).startForResult(REQUEST_CODE);

	}

	@Click
	void button13() {
		ModifyPWDActivity_.intent(this).start();

	}

	@Click
	void button14() {
		StudioListActivity_.intent(this).startForResult(REQUEST_CODE);
	}

	@Click
	void button15() {
		PaymentActivity_.intent(this).extra("orderid", "10").start();
	}

	@Click
	void button16() {
		BookActivity_.intent(this).extra("id", "1").start();
	}

	@Click
	void button22() {
		ComboListActivity_.intent(this).start();
	}

	@Click
	void button21() {
		// setContentView(R.layout.book_ranfa_dialog);
		CommentSubmitActivity_.intent(this).extra("dresserid", "1")
				.extra("orderid", "2").start();

	}

	String couponid = "";

	@Click
	void button20() {

		CouponListActivity_.intent(this).extra("couponid", couponid)
				.startForResult(REQUEST_CODE_VALID_COUPON);
		// setContentView(R.layout.book_ranfa_dialog);
	}

	@OnActivityResult(REQUEST_CODE_VALID_COUPON)
	void onResultCOMBO(int resultcode, Intent data) {
		if (resultcode == RESULT_CANCELED) {
			return;
		}
		if (data != null) {
			try {
				JSONObject obj = new JSONObject(
						data.getStringExtra("jsonString"));
				couponid = getJsonString(obj, "id");
			} catch (JSONException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	@Click
	void button19() {
		// setContentView(R.layout.book_ranfa_dialog);
		CouponGetListActivity_.intent(this).start();
	}

	@Click
	void button18() {
		// setContentView(R.layout.book_ranfa_dialog);
		CouponMineActivity_.intent(this).start();
	}

	@Click
	void button17() {
		// setContentView(R.layout.book_ranfa_dialog);
		OrdersActivity_.intent(this).start();
	}

}
